package util

import (
	"math/rand"
	"time"
)

func init() {
	rand.Seed(time.Now().UnixNano())
}

func Randint(s int, t ...int) int {
	switch len(t) {
	case 0:
		return rand.Intn(s)
	case 1:
		return rand.Intn(t[0]-s) + s
	}

	panic("invalid argument to Randint")
}
